package org.springframework.learn.beans.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import javax.annotation.Nullable;

/**
 * Description
 * Copyright © 启明星辰 版权所有
 *
 * @author chenjiquan
 * @date 2024-02-20
 */
//@Lazy
public class OrderService {

	private UserService userService;

	@Autowired(required = false)
	public OrderService() {
		System.out.println("0");
	}

	@Autowired(required = false)
	public OrderService(UserService userService) {
		System.out.println("1");
		this.userService = userService;
	}

	@Autowired(required = false)
	public OrderService(UserService userService, UserService userService1) {
		System.out.println("2");
		this.userService = userService;
		System.out.println(userService);
		System.out.println(userService1);
	}

	@Autowired(required = false)
	public OrderService(UserService userService, UserService userService1, UserService userService2) {
		System.out.println("3");
		this.userService = userService;
		System.out.println(userService);
		System.out.println(userService1);
		System.out.println(userService2);
	}

	@Nullable
	@EventListener
	public void testEvent(ApplicationEvent event) {
		System.out.println(event);
	}


}
